<template>
  <router-view v-if="this.isRouterAlive"></router-view>
</template>

<script>
export default {
  name: "App",
  provide() {
    //全局注册一个方法  控制页面刷新
    return {
      reload: this.reload,
    };
  },
  data() {
    return {
      isRouterAlive: true,
    };
  },
  methods: {
    reload() {
      //刷新页面
      this.isRouterAlive = false;
      this.$nextTick(() => {
        this.isRouterAlive = true;
      });
    },
  },
};
</script>

<style lang="stylus"></style>
